package com.cn.main.framework.scanner;

import org.springframework.beans.factory.config.BeanDefinitionHolder;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.context.annotation.ClassPathBeanDefinitionScanner;
import org.springframework.core.type.filter.AnnotationTypeFilter;

import java.util.Set;

/**
 * @aothor chenyuncong
 * @Date 2022/9/4 上午10:07
 */
public class ProxyInterfaceBeanBeanDefinitionScanner extends ClassPathBeanDefinitionScanner {
    public ProxyInterfaceBeanBeanDefinitionScanner(BeanDefinitionRegistry registry) {
        super(registry);
    }
    @Override
    protected Set<BeanDefinitionHolder> doScan(String... basePackages) {
        //添加过了注解
//        addIncludeFilter(new AnnotationTypeFilter(ProxyBean.class));
        //扫描出来对应的BeanDefinitionHolder
        Set<BeanDefinitionHolder> beanDefinitionHolders = super.doScan(basePackages);

        return beanDefinitionHolders;
    }
}
